<template>
  <div>
      <h2>父组件</h2>
      <button @click="add">+++</button>
  </div>
  <Son @sendNum="fn" :count="count"/>
</template>

<script>
import { ref } from 'vue'
import Son from './Son.vue'
export default {
    components: {
        Son
    },
    setup() {
        let count = ref(100)
        const add = () => {
            count.value += 1
        }


        const fn = (num) => {
            console.log(num)
        }

        return {
            count,
            add,
            fn
        }
    }
}
</script>

<style>

</style>